import cv2
import numpy as np
 
path1 = 'part1.png'
path2 = 'part4.png'
 
img1 = cv2.imread(path1)
img2 = cv2.imread(path2)

height1, width1, _ = img1.shape
height2, width2, _ = img2.shape

# new image
final_matrix = np.zeros((height1, width1+width2, 3), np.uint8)
# change 
final_matrix[0:height1, 0:width1] = img1
final_matrix[0:height1, width1:width1+width2] = img2
 
# cv2.imshow('img1', img1)
# cv2.imshow('img2', img2)
cv2.imshow('image', final_matrix)
cv2.imwrite('test.png', final_matrix)
cv2.waitKey()